﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;
using System.Windows.Interop;
using System.Runtime.InteropServices;
using System.Windows.Controls;

namespace System.Windows.Controls
{
    /// <summary>
    /// Extensions on class FrameworkElement.
    /// </summary>
    public static class FrameworkElementExtensions
    {
        /// <summary>
        /// Returns the center point of the FrameworkElement.
        /// </summary>
        /// <param name="visual"></param>
        /// <returns></returns>
        public static Point GetCenterPoint(this FrameworkElement visual)
        {
            return new Point(visual.ActualWidth * 0.5, visual.ActualHeight * 0.5);
        }
    }
}
